using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using Yoozoo.UI;
public class DOTweenAnimationBinderTreeItem : BindingBinderTreeItemBase
{
    public static Dictionary<DOTweenAnimationBinder.AttributeType, LinkerValueState> AttributeValueDic = new Dictionary<DOTweenAnimationBinder.AttributeType, LinkerValueState>
    {
        {DOTweenAnimationBinder.AttributeType.targetIsSelf, LinkerValueState.Boolean},
        {DOTweenAnimationBinder.AttributeType.tweenTargetIsTargetGO, LinkerValueState.Boolean},
        {DOTweenAnimationBinder.AttributeType.delay, LinkerValueState.Single},
        {DOTweenAnimationBinder.AttributeType.duration, LinkerValueState.Single},
        {DOTweenAnimationBinder.AttributeType.loops, LinkerValueState.Int32},
        {DOTweenAnimationBinder.AttributeType.id, LinkerValueState.String},
        {DOTweenAnimationBinder.AttributeType.isRelative, LinkerValueState.Boolean},
        {DOTweenAnimationBinder.AttributeType.isFrom, LinkerValueState.Boolean},
        {DOTweenAnimationBinder.AttributeType.isIndependentUpdate, LinkerValueState.Boolean},
        {DOTweenAnimationBinder.AttributeType.autoKill, LinkerValueState.Boolean},
        {DOTweenAnimationBinder.AttributeType.isActive, LinkerValueState.Boolean},
        {DOTweenAnimationBinder.AttributeType.isValid, LinkerValueState.Boolean},
        {DOTweenAnimationBinder.AttributeType.autoPlay, LinkerValueState.Boolean},
        {DOTweenAnimationBinder.AttributeType.useTargetAsV3, LinkerValueState.Boolean},
        {DOTweenAnimationBinder.AttributeType.endValueFloat, LinkerValueState.Single},
        {DOTweenAnimationBinder.AttributeType.endValueV3, LinkerValueState.Vector3},
        {DOTweenAnimationBinder.AttributeType.endValueV2, LinkerValueState.Vector2},
        {DOTweenAnimationBinder.AttributeType.endValueColor, LinkerValueState.Color},
        {DOTweenAnimationBinder.AttributeType.endValueString, LinkerValueState.String},
        {DOTweenAnimationBinder.AttributeType.endValueRect, LinkerValueState.Rect},
        {DOTweenAnimationBinder.AttributeType.optionalBool0, LinkerValueState.Boolean},
        {DOTweenAnimationBinder.AttributeType.optionalFloat0, LinkerValueState.Single},
        {DOTweenAnimationBinder.AttributeType.optionalInt0, LinkerValueState.Int32},
        {DOTweenAnimationBinder.AttributeType.optionalString, LinkerValueState.String},
        {DOTweenAnimationBinder.AttributeType.isSpeedBased, LinkerValueState.Boolean},
        {DOTweenAnimationBinder.AttributeType.hasOnStart, LinkerValueState.Boolean},
        {DOTweenAnimationBinder.AttributeType.hasOnPlay, LinkerValueState.Boolean},
        {DOTweenAnimationBinder.AttributeType.hasOnUpdate, LinkerValueState.Boolean},
        {DOTweenAnimationBinder.AttributeType.hasOnStepComplete, LinkerValueState.Boolean},
        {DOTweenAnimationBinder.AttributeType.hasOnComplete, LinkerValueState.Boolean},
        {DOTweenAnimationBinder.AttributeType.hasOnTweenCreated, LinkerValueState.Boolean},
        {DOTweenAnimationBinder.AttributeType.hasOnRewind, LinkerValueState.Boolean},
        {DOTweenAnimationBinder.AttributeType.onStart, LinkerValueState.UnityEvent},
        {DOTweenAnimationBinder.AttributeType.onPlay, LinkerValueState.UnityEvent},
        {DOTweenAnimationBinder.AttributeType.onUpdate, LinkerValueState.UnityEvent},
        {DOTweenAnimationBinder.AttributeType.onStepComplete, LinkerValueState.UnityEvent},
        {DOTweenAnimationBinder.AttributeType.onComplete, LinkerValueState.UnityEvent},
        {DOTweenAnimationBinder.AttributeType.onTweenCreated, LinkerValueState.UnityEvent},
        {DOTweenAnimationBinder.AttributeType.onRewind, LinkerValueState.UnityEvent},
        {DOTweenAnimationBinder.AttributeType.enabled, LinkerValueState.Boolean},
    };
    public DOTweenAnimationBinderTreeItem() : base(typeof(DOTweenAnimationBinder))
    {
    }
    
    public override void RebuildTree()
    {
        base.RebuildTree();
        foreach (DOTweenAnimationBinder.AttributeType binderType in Enum.GetValues(typeof(DOTweenAnimationBinder.AttributeType)))
        {
            BindingLinkerTreeItem linkerTreeItem = new BindingLinkerTreeItem(binderType.ToString(), binderType.ToString(), (int)AttributeValueDic[binderType]);
            AddChild(linkerTreeItem);
        }
    }
}